package com.guomao.demog;

import java.util.List;
import java.util.function.Consumer;

public class JavaDemo {

    public static void main(String[] args) {

        List<String> names = List.of("root", "admin");

        /*names.forEach(new Consumer<String>() {
            @Override
            public void accept(String name) {
                System.out.println("hello, " + name);
            }
        });*/

        /*names.forEach((String name) -> {
            System.out.println("hello:" + name);
        });*/

//        names.forEach(name -> System.out.println("hello:" + name));

        names.forEach(System.out::println);

    }

}
